package org.apache.rocketmq.proxy.service.message;

import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.consumer.ReceiptHandle;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageQueue;
import org.apache.rocketmq.proxy.common.ProxyContext;
import org.apache.rocketmq.proxy.service.route.AddressableMessageQueue;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;
import org.apache.rocketmq.remoting.protocol.header.EndTransactionRequestHeader;
import org.apache.rocketmq.remoting.protocol.header.GetMaxOffsetRequestHeader;
import org.apache.rocketmq.remoting.protocol.header.SendMessageRequestHeader;

import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;


public interface MessageService {

    CompletableFuture<List<SendResult>> sendMessage(
            ProxyContext ctx,
            AddressableMessageQueue messageQueue,
            List<Message> msgList,
            SendMessageRequestHeader requestHeader,
            long timeoutMillis
    );



    CompletableFuture<Long> getMaxOffset(
            ProxyContext ctx,
            AddressableMessageQueue messageQueue,
            GetMaxOffsetRequestHeader requestHeader,
            long timeoutMillis
    );


    CompletableFuture<RemotingCommand> request(ProxyContext ctx, String brokerName, RemotingCommand request,
                                               long timeoutMillis);

    CompletableFuture<Void> requestOneway(ProxyContext ctx, String brokerName, RemotingCommand request,
                                          long timeoutMillis);
}
